home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / dbaseacc.arc / JOBINDX.PRG < prev    next >
Encoding:
Text File  |  1979-12-31  |  1.1 KB  |  34 lines

  1.    ******************** JOBSINDX COMMAND FILE ********************
  2. * Indexes the costbase on job numbers to Jobs.NDX.
  3. *      The method of indexing here allows us to use the index to help
  4. * find job numbers for the Job Costs command files, but allows us to 
  5. * do so without having to index the Costbase every time we add a bill.
  6. *      The strategy is: before we index the Costbase on job numbers,
  7. * we first store the number of the last record in a record with a job
  8. * number of zero.  When the file is indexed, this record is at the top
  9. * of the indexed file ($Jobs) so that we can find it whenever we want to.
  10. **************************************************************************
  11.  
  12. USE Costbase
  13. GO BOTTOM
  14. STORE STR(#,5) TO Temp
  15. GO TOP
  16. IF Job:Nmbr = 0
  17.    REPLACE Name WITH Temp
  18. ELSE
  19.    DO WHILE !(Code) <> 'H'
  20.       ? "Uh, Oh--trouble.  Don't touch anything"
  21.       ACCEPT 'and call Hal.' To Code
  22.    ENDDO
  23. ENDIF
  24.  
  25. DELETE FILE $Jobs.NDX
  26. ERASE
  27. @5,0 SAY 'There are ' + Temp + ' records to index.'
  28. SET TALK ON
  29. INDEX ON Job:Nmbr TO $Jobs
  30. SET TALK OFF
  31.  
  32. RELEASE Temp
  33. RETURN
  34.